package com.twu.biblioteca;

import java.util.Arrays;
import java.util.Scanner;

public class BibliotecaApp {

    public static void main(String[] args) {

        State currentState = MainMenuState.instance;

        do{
            System.out.println(Arrays.toString(currentState.getOptions()));
            Scanner scanner = new Scanner(System.in);
            String choice = scanner.next();

            if (currentState.isValidInput(choice))
                currentState = currentState.act(choice);
            else
                System.out.println("Please enter valid option!");
        } while(currentState != null);

        System.out.println("Good Bye!");


   /*     Menu menuInstance = new Menu();

        System.out.println(menuInstance.getWelcomeMessage());
        System.out.println("Library menu options: ");

        System.out.println(Arrays.toString(menuInstance.getMenu()));

        System.out.println("\nEnter the number of your menu option: ");

        Scanner scanner = new Scanner(System.in);
        String choice = scanner.next();
        while(menuInstance.act(choice)){
            choice = scanner.next();
        }*/

    }

}
